from socket import *
from multiprocessing import *

mySocket = socket(AF_INET, SOCK_STREAM)


mySocket.setsockopt(SOL_SOCKET,SO_REUSEADDR,1)

localAddr = ('',7788)

mySocket.bind(localAddr)

mySocket.listen(5)


while True:
    print('')

    newSocket,destAddr = mySocket.accept()


    client = Process(target=dealwithsocket, args=(newSocket,destAddr))
    client.start()
    newSocket.close()


    try:
        while True:
            recvData = newSocket.recv(1024)
            if len(recvData)>0:
                print('')
            else:
                break
    finally:
        newSocket.close()

socket.close()


